// 云对象教程: https://uniapp.dcloud.net.cn/uniCloud/cloud-obj
// jsdoc语法提示教程：https://ask.dcloud.net.cn/docs/#//ask.dcloud.net.cn/article/129
module.exports = {
	// 微信登录openid
	async login(item) {
		let appid = 'wx912903619c27f196'
		let secret = 'd21ee07337d9a0b75fd64a270a76657a'
		let url =
			`https://api.weixin.qq.com/sns/jscode2session?appid=${appid}&secret=${secret}&js_code=${item}&grant_type=authorization_code`

		let res = await uniCloud.httpclient.request(url, {
			dataType: "json"
		})
		let openid = res.data.openid
		return openid

	},
}